package com.ruoyi.project.check.controller;

import com.ruoyi.framework.aspectj.lang.annotation.Log;
import com.ruoyi.framework.aspectj.lang.enums.BusinessType;
import com.ruoyi.framework.web.controller.BaseController;
import com.ruoyi.framework.web.domain.AjaxResult;
import com.ruoyi.framework.web.page.TableDataInfo;
import com.ruoyi.project.check.domian.Hoscheck;
import com.ruoyi.project.check.domian.Hosresultselect;
import com.ruoyi.project.check.service.IHosResultenetyService;
import com.ruoyi.project.check.service.IHosResultselectService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.web.bind.annotation.*;

import java.util.List;

@RestController
@RequestMapping("project/resultselect")
public class HosResultselectController extends BaseController {

    @Autowired
    private IHosResultselectService hosResultselectService;
    /**
     * 页面数据显示
     * @param hosresultselect
     * @return
     */
    @PreAuthorize("@ss.hasPermi('project:resultenety:list')")
    @GetMapping("/list")
    public TableDataInfo list(Hosresultselect hosresultselect){
        startPage();
        List<Hosresultselect> list = hosResultselectService.selectHosResultselectlist(hosresultselect);
        return getDataTable(list);
    }
    /**
     *回显数据
     * @param checkId
     * @return
     */
    @PreAuthorize("@ss.hasPermi('project:resultenety:query')")
    @GetMapping(value = "/{checkId}")
    public AjaxResult getInfo( @PathVariable("checkId") Long checkId){
        return AjaxResult.success(hosResultselectService.selectHosResultselectById(checkId));
    }

    /**
     *修改录入
     * @param hosresultselect
     * @return
     */
    @PreAuthorize("@ss.hasPermi('project:resultenety:edit')")
    @Log(title = "【请填写功能名称】", businessType = BusinessType.UPDATE)
    @PutMapping
    public AjaxResult edit(@RequestBody Hosresultselect hosresultselect){
        return AjaxResult.success(hosResultselectService.updateHosResultselect(hosresultselect));
    }


}
